summaryrefslogtreecommitdiff
path: root/app/[lng]/evcp/(evcp)/(system)/information/page.tsx
blob: ff8c702463b34616dde4e0cfec0d7f72fd581ea4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import * as React from "react"
import type { Metadata } from "next"
import { unstable_noStore as noStore } from "next/cache"

import { Shell } from "@/components/shell"
import { getInformationLists } from "@/lib/information/service"
import { InformationClient } from "@/components/information/information-client"
import { InformationButton } from "@/components/information/information-button"
import { useTranslation } from "@/i18n"

export const metadata: Metadata = {
  title: "안내사항 관리",
  description: "페이지별 도움말 및 첨부파일을 관리합니다.",
}

interface InformationPageProps {
  params: Promise<{ lng: string }>
}

export default async function InformationPage({ params }: InformationPageProps) {
  noStore()
  
  const { lng } = await params
  const { t } = await useTranslation(lng, 'menu')

  // 초기 데이터 로딩 (간단화)
  const initialData = await getInformationLists()

  // 서버사이드에서 번역된 데이터 생성
  const translatedData = initialData?.data?.map(item => ({
    ...item,
    translatedPageName: t(item.pageName)
  })) || []

  return (
    <Shell className="gap-2">
      <div className="flex items-center justify-between space-y-2">
        <div className="flex items-center justify-between space-y-2">
          <div>
            <div className="flex items-center gap-2">
              <h2 className="text-2xl font-bold tracking-tight">
                {t('menu.information_system.information')}
              </h2>
              <InformationButton pagePath="/evcp/information" />
            </div>
          </div>
        </div>
      </div>
      <InformationClient initialData={translatedData} />
    </Shell>
  )
}